<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>随机点名</title>
</head>
<body>
    <script>
         function getRandom(min, max);
         {
            return Math. floor(Math. random()* (max- min+ 1))+ min;
        }
        var arr=['关羽','张飞','马超','刘备','曹操','黄忠','赵云'];
        var  random= getRandom(0, arr.length-1);
        document. write(arr[random]);
        arr. splice(random, 1);
        console.log(arr);
    </script>
</body>
</html>
